﻿using System.Collections.Generic;
using System.Data.Entity.Migrations;
using WebApiSelfHost.Contexts;
using WebApiSelfHost.Models;

namespace WebApiSelfHost.Migrations
{
    public class Configuration : DbMigrationsConfiguration<Context>
    {
        public Configuration()
        {
            AutomaticMigrationsEnabled = true;
            AutomaticMigrationDataLossAllowed = true;
        }

        protected override void Seed(Context context)
        {
            context.Certificate.AddOrUpdate(
                new Certificate() { CertificateId = 1, Name = "C", Discription = "C" },
                new Certificate() { CertificateId = 2, Name = "C++", Discription = "C++" },
                new Certificate() { CertificateId = 3, Name = "C#", Discription = "C#" },
                new Certificate() { CertificateId = 4, Name = ".NET", Discription = ".NET" },
                new Certificate() { CertificateId = 5, Name = "SQL", Discription = "SQL" }                
                );

            context.Location.AddOrUpdate(
                new Location() { LocationId = 1, Name = "Bangalore", Discription = "Bangalore" },
                new Location() { LocationId = 2, Name = "Delhi", Discription = "Delhi" },
                new Location() { LocationId = 3, Name = "Kolkata", Discription = "Kolkata" },
                new Location() { LocationId = 4, Name = "Patna", Discription = "Patna" },
                new Location() { LocationId = 5, Name = "Chenni", Discription = "Chenni" }
                );

            base.Seed(context);
        }
    }
}